import Router from 'koa-router'

import DlyUserController from '../controller/dlyadmin/userController'

const router = new Router()

router.prefix('/dlyadminapi')

router
	/**
	 * @swagger
	 * /dlyadminapi/registry:
	 *   post:
	 *     description: 注册后台账号
	 *     tags: [后台用户]
	 *     summary: "注册后台账号"
	 *     parameters:
	 *       - name: phone
	 *         in: query
	 *         description: 手机号
	 *         required: true
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
	.post('/registry', DlyUserController.registry)
	.post('/addAdminUser', DlyUserController.addAdminUser)
    /**
	 * @swagger
	 * /dlyadminapi/editAgentsUserInfo:
	 *   put:
	 *     description: 修改子账号信息
	 *     tags: [后台用户]
	 *     summary: "修改子账号信息"
	 *     parameters:
	 *       - name: phone
	 *         in: query
	 *         description: 手机号
	 *         required: true
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
    .put('/editAgentsUserInfo', DlyUserController.editAgentsUserInfo)
	.post('/login', DlyUserController.login)
	/**
	 * @swagger
	 * /dlyadminapi/changePassword:
	 *   post:
	 *     description: 修改密码
	 *     tags: [后台用户]
	 *     summary: "修改密码"
	 *     parameters:
	 *       - name: oldpass
	 *         in: body
	 *         description: 原密码
	 *         required: true
	 *       - name: newpass
	 *         in: body
	 *         description: 新密码
	 *         required: true
	 *       - name: confirmpass
	 *         in: body
	 *         description: 确认密码
	 *         required: true
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
	.post('/changePassword', DlyUserController.changePassword)
	/**
	 * @swagger
	 * /dlyadminapi/changeUserInfo:
	 *   post:
	 *     description: 修改用户信息
	 *     tags: [后台用户]
	 *     summary: "修改用户信息"
	 *     parameters:
	 *       - name: userName
	 *         in: body
	 *         description: 用户名
	 *         required: false
	 *       - name: role
	 *         in: body
	 *         description: '--'
	 *         required: false
	 *       - name: binkCard
	 *         in: body
	 *         description: 银行卡
	 *         required: false
	 *       - name: binkLocation
	 *         in: body
	 *         description: 开户行地址
	 *         required: false
	 *       - name: binkName
	 *         in: body
	 *         description: 银行名
	 *         required: false
	 *       - name: usePayment
	 *         in: body
	 *         description: 默认收款方式 1 银行卡 2支付宝
	 *         required: false
	 *       - name: aliAccount
	 *         in: body
	 *         description: 支付宝账号
	 *         required: false
	 *       - name: aliName
	 *         in: body
	 *         description: 支付宝名称
	 *         required: false
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
	.post('/changeUserInfo', DlyUserController.changeUserInfo)
	/**
	 * @swagger
	 * /dlyadminapi/getUserInfo:
	 *   get:
	 *     description: 获取用户详情
	 *     tags: [后台用户]
	 *     summary: "获取用户详情"
	 *     parameters:
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
	.get('/getUserInfo', DlyUserController.getUserInfo)

    /**
	 * @swagger
	 * /dlyadminapi/getAgentsUserList:
	 *   get:
	 *     description: 获取子账号列表
	 *     tags: [后台用户]
	 *     summary: "获取子账号列表"
	 *     parameters:
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
    .get('/getAgentsUserList', DlyUserController.getAgentsUserList)

    /**
	 * @swagger
	 * /dlyadminapi/deleteAgentsUser:
	 *   get:
	 *     description: 删除账号
	 *     tags: [后台用户]
	 *     summary: "删除账号"
	 *     parameters:
	 *     produces:
	 *       - application/json
	 *     responses:
	 *       200:
	 *         description: 获取数据列表
	 * */
    .delete('/deleteAgentsUser', DlyUserController.deleteAgentsUser)
	.get('/test', DlyUserController.login)

export default router
